package heima3_2.cn.osc.presenter;

import android.util.Log;

import java.util.List;

import heima3_2.cn.osc.model.bean.ActiveBean;
import heima3_2.cn.osc.model.bean.ExploreFriendBean;
import heima3_2.cn.osc.ui.activity.FriendsActivity;
import retrofit2.Call;
import retrofit2.Response;

/**
 * Created by emily on 2017/1/15.
 */

public class FriendsPresenter extends BasePresenter<ExploreFriendBean>{

    private FriendsActivity friendsActivity;

    public FriendsPresenter(FriendsActivity friendsActivity) {
        this.friendsActivity = friendsActivity;
    }

    @Override
    protected void getFailureData(Throwable t) {
        t.printStackTrace();
    }

    @Override
    protected void getSuccessData(Response<ExploreFriendBean> response) {
        Log.d("this222", response.body()+"");
        ExploreFriendBean body = response.body();
        List<ActiveBean> activies = body.getActivies();

        friendsActivity.friendsAdapater.setDatas(activies);
    }
    @Override
    public void getData(int pager) {
        //3227258,0,1,20
    Call<ExploreFriendBean> info = mRetrofitInterface.getExploreFriendInfo();
    info.enqueue(mCallback);
    }
}
